# -*- encoding: utf-8 -*-
'''
Filename         :maxArea.py
Description      :
Time             :2022/08/08 08:51:13
Author           :daiyizheng
Email            :387942239@qq.com
Version          :1.0
'''

from typing import List


class Solution:
    def maxArea(self, height: List[int]) -> int:
        left = 0
        right = len(height) - 1
        ans = 0
        while left < right:
            ans = max(ans, min(height[left], height[right])*(right-left))
            if height[left]>height[right]:
                right -=1
            else:
                left+=1
        return ans
